The present invention relates generally to a system and method for generating a route map. More particularly, this invention relates to a system and method for applying a unique scale factor to each road in a route map and for optimizing the positions of labels in the route map. Further, a method for rendering the appearance of roads in the route map is disclosed.
Route maps, when well designed, are an effective device for visualizing and communicating directions. Such maps have existed in various forms for centuries, and the recent availability of detailed geographic databases via the Internet has led to the widespread use of computer-generated route maps. Online mapping services typically provide directions as a set of maps complemented with text descriptions. Such on-line computer-generated maps are unsatisfactory, however, because the algorithms used to generate the maps disregard many of the techniques and principles used by human map-makers.
Effective use of a route map generally requires two distinct activities: (i) following a path until reaching a critical point and (ii) changing orientation to follow another path. Thus, one of the most important types of information route maps can communicate are points of reorientation. That is, where someone must consciously turn from one path to another. However, existing computer-generated route maps fail to effectively communicate points of reorientation because they typically uniformly scale all the roads in the map by a constant scale factor. As an example, for routes of any reasonable length, uniform scaling requires some roads to be very short so that the map will fit in a particular viewport. But it is precisely these very short roads that connect critical turning points. Thus, uniform scaling results in a loss of some of the most critical information found in a route map.
Another shortcoming in prior art computer-generated route maps is that they needlessly depict accurate length, angle, and curvature of each road in the route. Such accurate depictions are made at the expense of map readability. Psychological research indicates that most people distort distances, angles, and curvature when drawing route maps. See e.g., Tversky and Lee, xe2x80x9cHow space structures language,xe2x80x9d Spatial Cognition: An interdisciplinary approach to representation and processing of spatial knowledge, (eds.) Freska, Habel, and Wender, 1998, 157-175; Tversky and Lee, xe2x80x9cPictorial and Verbal Tools for Conveying Routes,xe2x80x9d COSIT 99, Conference Proceedings, Stade Germany, 1999, 51-64. Other psychological studies indicate that people maintain such distortions in their own mental representations of a route. See e.g., Tversky, xe2x80x9cDistortions in Cognitive Maps,xe2x80x9d Geoforum 23, 1992, 131-138. Thus, adherence to accurate lengths and angles in prior art computer-generated maps runs counter to how humans conceptualize routes.
Computer-generated route maps can be classified into four major mapping styles: route highlight maps, TripTiks, overview/detail maps, and two dimensional nonlinear distortion maps. Route highlight maps simply highlight the route on a general road map of the region, as shown in FIG. 1. Since the purpose of general road maps is to provide an understanding of the entire road system in a region, such maps typically employ constant scale factors and display extraneous detail throughout the map. The constant scaling, as exhibited in FIG. 1, generally causes one of two problems. Either detailed turn information is lost because the scale factor is too large, or the scale factor is small enough to show the detail, but the map is very large. Since general road maps are not optimized to show any particular route, a route highlight map will often suffer from both a large scale factor and an inconvenient size. The clarity of the route in a route highlight map depends on the style of the highlighting since that is the only property differentiating the route from other roads. Usually the route is distinctively colored, but because general road maps provide context information over the entire map, the map is cluttered with extraneous information that makes it difficult to perceive the route and the individual reorientation points.
TripTiks are similar to route highlight maps, but they are specifically designed for communicating a particular route. As shown in FIG. 2, a TripTik map usually stretches over multiple rectangular pages, and each page is oriented so that the route runs roughly down the center of the page. Each TripTik page employs constant scaling, but the scale factor differs across pages. Changing the scale factor from page to page allows the TripTik to show more detailed turn information where needed. However, because the map stretches over many pages and the orientation and scale factor varies from page to page, forming a general understanding of the overall route is difficult.
Overview/detail maps combine multiple maps rendered at different scales to present a single route, as shown in FIG. 3. One of the maps (e.g., FIG. 3a) is scaled by a large factor so that it provides an overview of the entire route. Since the large scale factor of this map reduces the readability of local turn details, maps showing turn-by-turn information are provided (e.g., FIG. 3b). A constant scale factor is used for each map, but the scale factor differs across the maps. While an overview/detail map may seem like an effective combination, such maps are unsatisfactory in practice. The overview map rarely presents more than the overall direction of the route. Although turn-by-turn maps provide detailed information for every turn, the use of distinct maps for each turn, often with different orientation and scale, makes it difficult to understand how the maps correspond to one another. Therefore, the navigator has difficulty forming a cognitive model of the route.
To ensure clear communication of all of the reorientation points, some parts of a route""s depiction may require a small scale factor while others require a large scale factor. Researchers have described attempts to use two dimensional nonlinear image distortion techniques on general road maps to provide focus-plus-context viewing. (See. e.g., Carpendale et al., xe2x80x9cThree-Dimensional Pliable Surfaces: For the Effective Presentation of Visual Information,xe2x80x9d Proceedings of the ACM Symposium on User Interface Software and Technology, UIST 95, 1995, 217-226; Keahey, xe2x80x9cThe Generalized Detail-In-Context Problem,xe2x80x9d Proceedings of the IEEE Symposium on Information Visualization, IEEE Visualization 1998). These techniques allow users to choose regions of the map they want to focus on and then apply a nonlinear magnification, such as a spherical distortion, to enlarge these focus regions. Such two dimensional distortion allows detailed information to be displayed only where relevant and often produces general area maps that can be conveniently displayed on a single page. However, a major problem with nonlinear two-dimensional distortion is that the regions at the edges between the magnified and non-magnified portions of the map undergo extreme distortion.
In an effective route map, all essential components of the route, especially the roads, are easily identifiable. The route is clearly marked and readily apparent even at a quick glance. The map contains only as much information as is necessary and is easy to carry and manipulate. To further such design goals, map content, precision, and rendering style must be carefully optimized. Map content includes important parameters such as a route start and end, as well as points of reorientation. Reorientation points are points along the route at which the navigator must change orientation and switch to a different road. Another important map design goal is the proper use of context information. The amount of context information included in the map greatly affects the utility of the map. Useful context information includes labels or names for a path on the route as well as landmarks along the route such as buildings, stop lights, or stop signs. When drawing a route map by hand, people most commonly use landmarks to indicate points of reorientation and, less frequently, to communicate progress along a road.
Environmental psychology studies have demonstrated that human generated route maps contain distortion. There are three primary types of distortion: (1) inaccurate path lengths, (2) incorrect turning angles at intersections, and (3) simplified road shape. For example, Tversky and Lee, COSIT 99 Conference Proceedings, 1999, 51-64, asked a group of students to sketch a route map between two locations near the Stanford University campus. Although they encouraged participants in their study to represent paths and intersections accurately, most did not. Most intersections were drawn at right angles regardless of their actual angle and seventy-one percent of the participants used simple generic curves and straight lines to represent roads. Even when participants intended to communicate the shape or length of the road accurately, they typically rendered these attributes incorrectly. Such distortion in the map is in fact beneficial because it increases the flexibility available to the map-maker in the design and layout of the map. Variably scaling the length of each road allows the map-maker to ensure all reorientation points are visible, while flexibility in choosing turning angles and road curvature allows the map to be simplified. Such distortions can simultaneously improve the readability and convenience of the route map with little adverse effect on its clarity and completeness.
Although all maps are abstract representations of a route, there is a range of styles that can be used to render a map, with varying associations of accuracy and realism. An appropriate rendering style can greatly affect the readability and clarity of a map. Retinal properties such as color and line thickness are used to draw attention to important features of the map. Rendering style can also aid the user in interpreting how closely the map corresponds with the real world.
Hand-drawn route maps often present a good combination of readability, clarity, completeness and convenience, as shown in FIG. 4. Instead of using a constant scale factor, hand-drawn maps only maintain the relative ordering of roads by length. While this ensures that longer roads appear longer than shorter roads in the map, each road is scaled by a different factor. Often the map designer does not know the exact length of the roads and only knows their lengths relative to one another. The flexibility of relative scaling allows hand-drawn route maps to fit within a manageable size and remain readable.
Hand-drawn route maps typically remove most contextual information that does not lie directly along the route. This strategy reduces overall clutter and improves clarity. The intersection angles in hand-drawn maps are generally incorrect, the precise shape of roads is often misrepresented, and the roads are typically depicted as generically straight or curved. These distortions make the map simpler and only remove unnecessary information.
Hand-drawn route maps are rendered in a xe2x80x9csketchyxe2x80x9d style typical of quick pen-and-ink doodling. Many navigators are familiar with such hand-drawn maps and the sketchy style is a subtle indicator of imprecision in the map.
Based on the above background it is apparent that what is needed in the art is an improved system and method for making computer-generated maps. What is further needed in the art is a system and method for making computer generated maps that avoid the pitfalls found in existing map-making algorithms, such as the use of extraneous information and constant scaling.
The present invention provides an improved system and method for making computer-generated maps. In the present invention, each road in a route is individually scaled. The scale factor for each road is optimized using an objective function that considers a number of factors such as the number of false intersections and the number of roads that are shorter than a minimum threshold length. Thus, the scaled route fits in a predetermined viewport without loss of information about important turns. Refinement against the objective function is performed by one of many possible search algorithms such as greedy searches, simulated annealing schedules, or gradient descents. Greedy search algorithms are described in Cormen et al., Introduction to Algorithms, eds. Cormen, Leiserson, and Rivest, MIT Press and McGraw-Hill, Location of publisher, 1990, 329-355. Simulated annealing was first disclosed by Kirkpatrick et al. in the article xe2x80x9cOptimization by Simulated Annealing,xe2x80x9d Science 220, 1983, 671-680.
Map clutter in the scaled map is avoided by refining label positions against a novel target function that minimizes the number of roads the labels intersect, the number of labels that intersect each other, and the distance between a label and the center of a road corresponding to the label. In one embodiment, simulated annealing is used to find a solution to the novel target function. The final scaled route map is rendered so that it has the appearance of a hand-drawn map. The rendered map clearly communicates every reorientation point in a readable and convenient form.
One embodiment of the present invention provides a method for preparing a route map that describes a path between a start and an end. The method comprises obtaining the path from the start to the end. In this embodiment, the path includes an initial set of elements. Each element in the set has enough information to determine a direction. Further, each element in the set intersects at least one other element in the set. A different individual scale factor is applied to each of at least two elements in the set to produce a scaled set of elements. Then, labels that correspond to elements in the scaled set are assigned label positions that are proximal to their corresponding elements. The position of the labels are refined against a target function and the resulting route map and refined labels are outputted to a viewport.
In one embodiment, the different individual scale factors that are applied to one or more elements is subject to the constraint that the relative ranking, based on length, of each element in the scaled set of elements is the same as the relative length of the corresponding element in the initial set of elements. In another embodiment, each element in the initial set of elements is assigned to a particular bin based on element length. Each bin represents a range of element lengths that does not overlap with a range of element lengths represented by other bins. A different bin scale factor is assigned to each bin and the bin scale factor is applied to each element in a bin.
In yet another embodiment, the route map includes a bounding edge and each scale factor that is applied to individual elements is derived by a series of steps. First, a single scale factor is applied to each element in the initial set of elements to form the scaled set of elements. This single scale factor is determined by a factor necessary to adjust the length of the shortest element in the initial set of elements so that it has a minimum acceptable length. Second, the path is traversed, beginning at the path origin, until an element that exceeds the bounding edge is identified. When such an offending element is identified, each element that has been traversed before reaching the offending element, which is longer than a minimum length and that has a direction that is within ninety degrees of the direction of the offending element, is noted. The noted elements are sorted by length, with the longest element first, to form a sorted list. Third, elements are sequentially selected from the sorted list of elements. When an element is selected, the scale factor associated with the selected element is adjusted so that the length of the selected element is minimized. In one embodiment, the scale factor is minimized using a greedy algorithm. Minimization of the scale factor is subjected to the constraint that the relative length of the element after application of the new scale factor is the same as the corresponding element in the initial set of elements. After the length of a selected element has been minimized, a check is performed to determine whether the offending element continues to exceed the bounding edge. When the offending element no longer exceeds the bounding edge, the process continues by again attempting to traverse the route, beginning at the path origin, until a new offending element is discovered. The traversal of the path is repeated until the complete path is traversed without the identification of an element that exceeds the bounding edge.
In another embodiment of the present invention, individual scale factors are derived using a simulated annealing schedule. First, a scale factor is applied to each element in the initial set of elements to form a scaled set of elements. The single scale factor is determined by a factor necessary to adjust the length of the shortest element in the initial set of elements so that it has a length that matches or exceeds a minimum length threshold. Then an initial temperature t is set and a first score (E1) is measured using an objective function that determines the quality of the scaled set of elements. In the next step, an arbitrary scale factor is applied to a randomly selected element in the scaled set of elements and a second score (E2) is measured using the same objective function. The arbitrary scale factor is automatically accepted when E2 is less than E1. The arbitrary scale is generally rejected when E2 is greater than E1. However, there is a small probability P(xcex94E) that the score is accepted when E2 is greater than E1. In one embodiment, this probability is:
P(xcex94E)=expxe2x88x92[(xcex94E)/(k*t)]
where, xcex94E=(E1)xe2x88x92(E2) and
k is a constant.
In alternative embodiments, other probability functions are used. Generally, any probability function that is dependent on temperature is suitable. Such probability functions include, for example, probability functions that are exponentially, linearly, and/or logarithmically dependent upon temperature t.
The process of assigning an arbitrary scale factor to a randomly selected element and then determining whether to accept the arbitrary scale factor is repeated a number of times before the temperature is decremented. When the temperature is decremented, the process of assigning an arbitrary scale factor to an element and determining whether to accept the scale factor again repeats for a number of times before the temperature is decremented. Temperature is repeatedly decremented in this manner until the first occurrence of an exit condition.
In one embodiment, the objective function that is used to obtain scores E1 and E2 is a summation of:
(i) a first weight multiplied by a number of false intersections existing between elements in the scaled set of elements;
(ii) a second weight multiplied by the number of elements in the scaled set of elements that do not have the same relative ordering by length as the corresponding element in the initial set of elements;
(iii) a third weight multiplied by a number of elements in the scaled set of elements having a length that is shorter than a minimum length threshold; and
(iv) a fourth weight multiplied by the number of elements in the scaled set of elements having a vector varying by more than a predetermined number of degrees from the vector of a corresponding element in the initial set of elements.
In still another embodiment of the present invention, the route map includes a set of labels. Each label in the set corresponds to a different element in the scaled set of elements. The positions of the labels in the set are refined using a simulated annealing schedule. Accordingly, an initial temperature t is set and then a label is randomly selected from the set of labels. A bounding box is defined for the selected label. The bounding box includes the center of the element corresponding to the selected label. The selected label is positioned at the center of the bounding box and a first score (S1) is determined using a novel target function. Then, the position of the label is adjusted by an amount before recalculating a second score (S2) using the target function and the new position of the label. The new position for the selected label is unconditionally accepted when S2 is less than S1. Further, there is a small probability P(xcex94S) that the score is accepted when S2 is less than S1. In one embodiment, the probability P(xcex94S) is defined as:
P(xcex94S)=expxe2x88x92[(xcex94S)/(k*t)]
where xcex94S=(S1)xe2x88x92(S2) and
k is a constant.
In alternative embodiments, other probability functions are used. Generally, any probability function that is dependent on temperature is suitable. Such probability functions include, for example, probability functions that are exponentially, linearly, and/or logarithmically dependent upon temperature.
The process of repositioning a randomly selected label and then determining whether to accept the new position for the selected label repeats a number of times before the temperature t is decremented. When the temperature is decremented, the process of repositioning a randomly selected label and determining whether to accept the new position repeats for a number of times before the temperature is again decremented. The temperature is repeatedly decremented in this manner until the first occurrence of an exit condition.
In one embodiment, the target function is determined by at least one of:
(i) a first weight multiplied by the number of elements that overlap with the selected label;
(ii) a second weight multiplied by the number of labels in the set of labels that the selected label overlaps;
(iii) a third weight multiplied by the number of annotations the selected label overlaps;
(iv) a fourth weight multiplied by a first heavy function; the first heavy function having a value of:
xe2x80x9c1xe2x80x9d when said label exceeds a dimension of the desired viewport, and a value of
xe2x80x9c0xe2x80x9d when the label does not exceed a dimension of the desired viewport;
(v) a fifth weight multiplied by a normalized distance between the selected label and the center of the element corresponding to the label; and
(vi) a sixth weight multiplied by a second heavy function where the second heavy function has the value:
xe2x80x9c1xe2x80x9d when the label is below the element corresponding to the label, and a value of
xe2x80x9c0xe2x80x9d when the label is above the corresponding element.
Another embodiment of the present invention provides a computer program product for use in conjunction with a computer system to prepare a route map having a path with a start to an end. The computer program product comprises a computer readable storage medium and a computer program mechanism embedded therein. The computer program mechanism comprises a direction parser module that includes instructions for obtaining the path. The path comprises an initial set of elements such as roads. Each element in the initial set of elements includes sufficient information to determine a direction. The computer program mechanism further comprises a road layout module that includes instructions for applying a different scale factor to at least two elements in the initial set of elements. Application of the different scale factor to each of at least two elements in the initial set of elements produces a scaled set of elements. The computer program mechanism further comprises a label layout module that includes instructions for assigning a label, which corresponds to an element in the scaled set of elements, to a label position that is proximal to the corresponding element. The label layout module also has instructions for determining a refined label position by refining an initial label position against a novel target function. Finally, the computer program mechanism comprises a map renderer module that includes instructions for outputting the label at the refined label position and instructions for rendering each element in the scaled set of elements.